package presenter;

import base.BasePresenter;
import base.ResultCallBack;
import bean.AllBean;
import model.AllModel;
import view.AllView;

/**
 * Created by 裘翔 on 2019/11/6.
 */

public class AllPresenter extends BasePresenter<AllView> implements ResultCallBack<AllBean> {
    private AllModel allModel;

    public AllPresenter() {
        this.allModel = new AllModel();
        addModel(allModel);
    }

    public void loadData(int start, int end) {
        allModel.loadData(this,start, end);
    }

    @Override
    public void onSuccess(AllBean allBean) {
        if (mView != null) {
            mView.onSuccess(allBean);
        }
    }

    @Override
    public void onFail(String error) {
        if (mView != null)
            mView.showToast(error);
        mView.onFailed(error);

}
}
